package br.edu.ufcg.ga.stopcondition;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

public class OptimalStopConditionTest {

	private OptimalStopCondition osc;

	@Before
	public void setUp() {
		this.osc = new OptimalStopCondition(140.0);
	}
	
	@Test
	public void testReachedStopCondition(){
		
		int generation = 0;
		
		assertFalse(this.osc.reached(generation++, 150.0));
		assertFalse(this.osc.reached(generation++, 151.0));
		assertFalse(this.osc.reached(generation++, 145.0));
		assertTrue(this.osc.reached(generation++, 140.0));
		
	}
	
}
